import { ApiProperty, PartialType } from '@nestjs/swagger';
import { CreateMenuDto } from './create-menu.dto';
import { IsNotEmpty, IsOptional } from 'class-validator';

export class UpdateMenuDto extends PartialType(CreateMenuDto) {
	@ApiProperty({
		example: '/auth',
		required: true,
		description: '菜单链接',
	})
	@IsNotEmpty()
	path: string;

	@ApiProperty({
		example: '权限管理',
		required: true,
		description: '菜单标题',
	})
	@IsNotEmpty()
	title: string;

	@ApiProperty({
		required: false,
		description: '父级权限',
	})
	@IsOptional()
	parentId: number;

	@ApiProperty({
		required: false,
		description: '菜单排序号',
	})
	@IsOptional()
	sortNumber: number;

	@ApiProperty({
		example: 'AppstoreOutlined',
		required: false,
		description: '菜单图标',
	})
	@IsOptional()
	icon: string;

	@ApiProperty({
		example: 1,
		required: true,
		description: '是否为文件夹',
	})
	@IsOptional()
	isDirectory: number;
}
